package com.xuan.webfinally.mapper;

import com.xuan.webfinally.entity.SysUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 用户信息表 Mapper 接口
 * </p>
 *
 * @author gyuxuan
 * @since 2025-05-18
 */
@Mapper
public interface SysUserMapper extends BaseMapper<SysUser> {

    @Select("select * from sys_user where user_name = #{username}")
    SysUser selectOne(String username);


    @Select( "select dept_id from sys_user where user_name = #{username}")
    Long selectDeptId(String username);

    @Select("select phonenumber from sys_user where user_name = #{username}")
    String selectPhone(String username);

    @Select("select phonenumber from sys_user where dept_id = #{deptId} limit 1")
    String selectPhoneById(Long deptId);
}
